.class public Lcom/zuiapps/suite/utils/device/GpsModeUtil;
.super Ljava/lang/Object;
.source "GpsModeUtil.java"


# static fields
.field private static final COMMAND_GPS_OFF_1:Ljava/lang/String; = "settings put secure location_providers_allowed off"

.field private static final COMMAND_GPS_OFF_2:Ljava/lang/String; = "am broadcast -a android.location.GPS_ENABLED_CHANGE --ez enabled false"

.field private static final COMMAND_GPS_ON_1:Ljava/lang/String; = "settings put secure location_providers_allowed gps,wifi,network"

.field private static final COMMAND_GPS_ON_2:Ljava/lang/String; = "am broadcast -a android.location.GPS_ENABLED_CHANGE --ez enabled true"


# instance fields
.field private mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 2
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 21
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 22
    iput-object p1, p0, Lcom/zuiapps/suite/utils/device/GpsModeUtil;->mContext:Landroid/content/Context;

    .line 23
    return-void
.end method


# virtual methods
.method public isGpsOpened()Z
    .registers 4

    .prologue
    .line 27
    :try_start_0
    iget-object v1, p0, Lcom/zuiapps/suite/utils/device/GpsModeUtil;->mContext:Landroid/content/Context;

    const-string v2, "location"

    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    .line 28
    .local v0, "locationManager":Landroid/location/LocationManager;
    const-string v1, "gps"

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z
    :try_end_f
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_f} :catch_11

    move-result v1

    .line 32
    .end local v0    # "locationManager":Landroid/location/LocationManager;
    :goto_10
    return v1

    .line 29
    :catch_11
    move-exception v1

    .line 32
    const/4 v1, 0x0

    goto :goto_10
.end method

.method public openGPSSetting()Landroid/content/Intent;
    .registers 3

    .prologue
    .line 47
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 48
    .local v0, "intent":Landroid/content/Intent;
    const-string v1, "android.settings.LOCATION_SOURCE_SETTINGS"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    .line 49
    const/high16 v1, 0x10000000

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 51
    return-object v0
.end method
